package com.szh.easyexcel.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * Excel下载对应的DTO类
 *
 * @author: SongZiHao
 * @date: 2023/5/27
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ColumnWidth(25)
@HeadRowHeight(30)
@ContentRowHeight(20)
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
public class StudentExcelDto {
    @ExcelProperty(value = {"学生综述", "学生学号"})
    private Long id;

    @ExcelProperty(value = {"学生综述", "学生姓名"})
    private String name;

    @ExcelProperty(value = {"学生综述", "学生年龄"})
    private Integer age;

    @ExcelProperty(value = {"学生综述", "学生爱好"})
    private String hobby;

    @ExcelProperty(value = {"学生综述", "学生住址"})
    private String address;

    @ColumnWidth(50)
    @DateTimeFormat(value = "yyyy年MM月dd日HH时mm分ss秒")
    @ExcelProperty(value = {"学生综述", "学生记录创建时间"})
    private Date createTime;
}
